package memory

import (
	"booking-service/internal/models"
	"sync"
)

type InMemoryOrderStorage struct {
	orders []models.Order
	mu     sync.Mutex
}

func (s *InMemoryOrderStorage) CreateOrder(order models.Order) error {
	s.mu.Lock()
	defer s.mu.Unlock()
	s.orders = append(s.orders, order)
	return nil
}

func (s *InMemoryOrderStorage) GetOrders() []models.Order {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.orders
}
